/*
 * @Descripttion: 
 * @version: 
 * @Author: yuanliutech
 * @Date: 2022-12-16 09:42:36
 * @LastEditors: yuanliutech@lwj
 * @LastEditTime: 2022-12-16 09:42:43
 */
// directive.js （和main.js同级）
import Vue from 'vue'

// 滚动加载更多
Vue.directive('loadMore', {
    bind(el, binding) {
        // 获取element，定义scroll
        let select_dom = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap');
        select_dom.addEventListener('scroll', function () {
            let height = this.scrollHeight - this.scrollTop <= this.clientHeight;
            if (height) {
                binding.value()
            }
        })
    }
})